import 'package:flutter/material.dart';

class Person {
  String code;

//<editor-fold desc="Data Methods" defaultstate="collapsed">

  Person({
    @required this.code,
  });

  Person copyWith({
    String code,
  }) {
    return new Person(
      code: code ?? this.code,
    );
  }

  @override
  String toString() {
    return 'Person{code: $code}';
  }

  @override
  bool operator ==(Object other) =>
      identical(this, other) ||
      (other is Person &&
          runtimeType == other.runtimeType &&
          code == other.code);

  @override
  int get hashCode => code.hashCode;

  factory Person.fromMap(Map<String, dynamic> map) {
    return new Person(
      code: map['code'] as String,
    );
  }

  Map<String, dynamic> toMap() {
    // ignore: unnecessary_cast
    return {
      'code': this.code,
    } as Map<String, dynamic>;
  }

//</editor-fold>

}